#ifndef __BULLET_MANAGER_H__
#define __BULLET_MANAGER_H__


#include "../Global.h"
#include "Bullet.h"

#include "BulletDefine.h"
#include "../PhysicSystem/PhysicObject.h"
#include "../PhysicSystem/PhysicManager.h"
#include "../Circle/Circle.h"


class BulletManager : public CCNode , public MemoryManagerDelegate , public ContactSolver
{
public:
	BulletManager( );
	virtual ~BulletManager( );

	static BulletManager*	sharedBulletManager			( );
	void					init						( int numBullet = 15 );
	void					initNextBullet				( int numInit );
	void					getBullet					( );

	void					fire						( const CCPoint& touchPoint );

	CREATE_SET_GET( CCSpriteBatchNode* , m_pBatchNode , BatchNode );
	CREATE_SET_GET( float , m_fBulletRadius , BulletRadius );

	void					beginContact				( PhysicObject* pContact_1 , PhysicObject* pContact_2 );

private:
	CCArray*			m_pListBullet;
	CCArray*			m_pListFocusBullet;


	Bullet*					getUnActiveBullet			( );
	Bullet*					getActiveBullet				( );
};


#endif